package com.cf.base.comm.tools;

import android.app.Activity;

import androidx.annotation.NonNull;

import com.cf.base.comm.callback.ActivityLifecycleCallbacks;

/**
 * @author yangji
 */
public class CurrentActivity extends ActivityLifecycleCallbacks {

    private Activity mCurrentActivity;

    @Override
    public void onActivityResumed(@NonNull Activity activity) {
        super.onActivityResumed(activity);
        this.mCurrentActivity = activity;
    }

    @Override
    public void onActivityPaused(@NonNull Activity activity) {
        super.onActivityPaused(activity);
        if (mCurrentActivity == activity) {
            mCurrentActivity = null;
        }
    }
}
